package com.test.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class SearchCriteria implements Serializable {

	/**
	 * Generated serial version UID.
	 */
	private static final long serialVersionUID = -338965481250487220L;

	private Map<String, Collection<? extends Object>> propertyCriteriaMap = new HashMap<String, Collection<? extends Object>>();

	private int pageNumber;

	private int itemsPerPage;

	public SearchCriteria() {
		super();
	}

	public SearchCriteria(final int pageNumber, final int itemsPerPage) {
		this.pageNumber = pageNumber;
		this.itemsPerPage = itemsPerPage;
	}

	public void addPropertyCriteria(final String property, final Object criteria) {
		propertyCriteriaMap.put(property, Collections.singletonList(criteria));
	}

	public void addPropertyCriteria(final String property, final Collection<? extends Object> criteria) {
		propertyCriteriaMap.put(property, criteria);
	}

	public Map<String, Collection<? extends Object>> getProperties() {
		return propertyCriteriaMap;
	}

	public void setProperties(Map<String, Collection<? extends Object>> propertyCriteriaMap) {
		this.propertyCriteriaMap = propertyCriteriaMap;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public int getItemsPerPage() {
		return itemsPerPage;
	}

	public void setItemsPerPage(int itemsPerPage) {
		this.itemsPerPage = itemsPerPage;
	}
}
